feat(miner): add slim laptop-mode status and doctor CLI commands#2866
Conversation
Add gittensory-miner status and gittensory-miner doctor: the miner CLI's first real commands. status (text or --json) prints the miner + pinned engine version, Node version, local-state directory, and discovered .gittensory-miner.yml config file. doctor checks Node major against the engines.node floor, the pinned engine version is readable, and the local-state directory is creatable/writable, exiting non-zero on failure. Both are read-only and 100% local — no repo-scanning, no GitHub writes, no network calls. lib/status.js holds pure, env/cwd-parameterized helpers; bin dispatches them like the existing hooks check. Closes JSONbored#2288.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2866 +/- ##
=======================================
Coverage 96.01% 96.01%
=======================================
Files 259 259
Lines 28304 28304
Branches 10291 10291
=======================================
Hits 27177 27177
Misses 491 491
Partials 636 636 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-04 02:11:03 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Adds the miner CLI's first real commands —
gittensory-miner statusandgittensory-miner doctor— the "slim laptop-mode entry point" the phase brief calls for. Both are read-only and 100% local: no repo-scanning, no coding-agent invocation, no GitHub writes, and no network calls of any kind.status(--jsonfor machine output) prints the installed miner + engine version, the local-state directory (where the run-state / queue / ledger SQLite files live), the Node version, and the discovered.gittensory-miner.ymlconfig file (ornone found).doctor(exit non-zero on any failure) checks: Node major ≥ theengines.nodefloor, the pinned@jsonbored/gittensory-engineversion is readable, and the local-state directory is creatable/writable. Mirrorsgittensory-mcp doctor's "is this laptop set up correctly" spirit.--helpnow lists both commands.Wiring mirrors the existing
hooks checkcommand:lib/status.jsexports purecollectStatus/runDoctorChecks(parameterized onenv/cwdfor testability) plusrunStatus/runDoctorhandlers, dispatched frombin/gittensory-miner.js.On the engine version: the engine package's
exportsmap blocksrequire("@jsonbored/gittensory-engine/package.json"), and its builtdist/may be absent depending on build order, so bothstatusanddoctorread the pinned dependency version from the miner's ownpackage.json— the reliable, always-available source of "which engine this miner is built against" — rather than resolving the installed package at runtime.Closes #2288.
Note (resubmit): an earlier revision was auto-closed by the gate because the bin started the opportunistic npm-registry update check for all commands, so
status/doctorcould reach that network path despite their no-network contract. Fixed:statusanddoctorare now dispatched at the top ofbin/gittensory-miner.js, beforestartUpdateCheckruns, so they never touch the update path (the check still runs for the other commands).Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run test:coveragelocally — the newtest/unit/miner-status.test.tspasses (whole miner suite green, 170 tests). This change lives entirely inpackages/**, which Codecov does not measure, so it carries nocodecov/patchobligation; the logic is nonetheless exercised across state-dir resolution, the status snapshot + config discovery, text vs--jsonoutput, doctor happy-path, the doctor failure (unwritable state dir → exit 1), and avi.stubGlobal("fetch")assertion that no network call is made.node --checkover the new files +binvianpm run --workspace @jsonbored/gittensory-miner buildnpm audit --audit-level=moderate— this PR adds no dependencies, so dependency-review has nothing new to evaluate.If any required check was skipped, explain why:
packages/gittensory-minerplus its test — nosrc/**, UI, API schema, DB, or Cloudflare-binding surface is touched.Safety
UI Evidencesection. — n/a: no visible UI, frontend, docs, or extension change (CLI text output only).Notes
Additive: a new
lib/status.js+lib/status.d.ts, two lines added to the--helptext, astatus/doctordispatch block inbin/gittensory-miner.js(mirroring the existinghooks checkblock), one line added to the packagebuildgate, and one new test file. No existing behavior is changed.